package com.bestcem.xm.txtanls.controller.convert;

import com.bestcem.xm.txtanls.controller.vo.topic.TopicVO;
import com.bestcem.xm.txtanls.service.dto.topic.TopicDTO;

import java.util.ArrayList;
import java.util.List;

/**
 * @author liheng
 * @version v2.0
 * @date 2021/8/6 14:14
 */

public class TopicConvert {

    private TopicConvert() {
    }

    /**
     * 话题相关，话题DTO转为VO
     *
     * @param topicDTOS 话题DTO list
     * @return proto 话题message
     * @author liheng
     * @date 2021/5/13 21:13
     */
    public static List<TopicVO> convertTopicDTOList(List<TopicDTO> topicDTOS) {
        ArrayList<TopicVO> topicVos = new ArrayList<>(topicDTOS.size());
        for (TopicDTO topicDTO : topicDTOS) {
            topicVos.add(convertTopicDTOList(topicDTO));
        }
        return topicVos;
    }

    /**
     * 话题相关，话题DTO转为VO
     *
     * @param topicDto 话题DTO list
     * @return proto 话题message
     * @author liheng
     * @date 2021/5/13 21:13
     */
    public static TopicVO convertTopicDTOList(TopicDTO topicDto) {

        TopicVO topicVO = new TopicVO();
        topicVO.setId(topicDto.getId());
        topicVO.setKeyDict(topicDto.getKeyDict());
        topicVO.setName(topicDto.getName());
//        topicVO.setTopicGId(topicDto.getTopicGid());
//        topicVO.setType(topicDto.getType());

        return topicVO;
    }

}
